package com.chapter8.example2;

/**
 * 简单工厂实现，增加新的类需要修改工程的源码
 */
public class SimpleFactory {
    public static LeiFeng createLeiFeng(String type){
        LeiFeng result = null;
        switch (type){
            case "学雷锋的大学生":
                result = new Undergraduate();
            case "社区志愿者":
                result = new Volunteer();
        }
        return result;
    }
}
